home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / smail-3.1.28 / src / route.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-11  |  2.1 KB  |  66 lines

  1. /* @(#)src/route.h    1.5 7/11/92 11:50:15 */
  2.  
  3. /*
  4.  *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  5.  *    Copyright (C) 1992  Ronald S. Karr
  6.  * 
  7.  * See the file COPYING, distributed with smail, for restriction
  8.  * and warranty information.
  9.  */
  10.  
  11. #ifndef    ROUTE_H
  12. #define ROUTE_H
  13.  
  14. /*
  15.  * route.h:
  16.  *    interface file for route.c.  Also, types and macros for
  17.  *    use by router drivers.
  18.  */
  19.  
  20. /* structure of a router, as read from the configuration file */
  21. struct router {
  22.     char *name;                /* name of router */
  23.     char *driver;            /* name of driver */
  24.     struct router *succ;        /* next router in the list */
  25.     long flags;                /* boolean flag values */
  26.     struct method *method;        /* table of host/tport associations */
  27.     char *default_transport;        /* name of default transport */
  28.     char *private;            /* private data storage */
  29. };
  30.  
  31. /* method - table associating hosts and transports */
  32. struct method {
  33.     char *host;                /* host name */
  34.     int mingrade;            /* min grading for this entry */
  35.     int maxgrade;            /* max grading for this entry */
  36.     char *transport;            /* transport name */
  37. };
  38.  
  39. /* compiled in route drivers */
  40. struct route_driver {
  41.     char *name;                /* name of route driver */
  42.     void (*cache)();            /* function to cache routing info */
  43.     void (*driver)();            /* function to perform routing */
  44.     void (*verify)();            /* function to perform verification */
  45.     void (*finish)();            /* function to free resources */
  46.     char *(*builder)();            /* fun to read from router file */
  47. };
  48.  
  49. /*
  50.  * structure for route information passed between the rt[dv]_standard
  51.  * routines and the various router drivers that use them; also used by
  52.  * bindlib, which is why it's here instead of routers/rtlib.h.
  53.  */
  54. struct rt_info {
  55.     char *next_host;            /* next-hop host string */
  56.     char *route;            /* route from next_host to target */
  57.     int matchlen;            /* length of match on target */
  58.     struct transport *transport;    /* optional transport */
  59.     struct transport_hints *tphint_list; /* options transport hints */
  60. };
  61.  
  62. /* values for router.flags field */
  63. #define USE_ALWAYS    0x0001        /* if match, don't use next router */
  64.  
  65. #endif    /* ROUTE_H */
  66.